package model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.sql.Date;

public class Book {
    private String bookNo;
    private String bookName;
    private String press;
    @JsonFormat(pattern = "yyyy-mm-dd")
    private Date pubTime;
    private String author;
    private String location;
    private double price;
    private boolean isBorrowed;

    public Book() {
    }

    public Book(String bookNo, String bookName, String press, Date pubTime, String author, String location, double price, boolean isBorrowed) {
        this.bookNo = bookNo;
        this.bookName = bookName;
        this.press = press;
        this.pubTime = pubTime;
        this.author = author;
        this.location = location;
        this.price = price;
        this.isBorrowed = isBorrowed;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookNo='" + bookNo + '\'' +
                ", bookName='" + bookName + '\'' +
                ", press='" + press + '\'' +
                ", pubTime=" + pubTime +
                ", author='" + author + '\'' +
                ", location='" + location + '\'' +
                ", price=" + price +
                ", isBorrowed=" + isBorrowed +
                '}';
    }

    public String getBookNo() {
        return bookNo;
    }

    public void setBookNo(String bookNo) {
        this.bookNo = bookNo;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public Date getPubTime() {
        return pubTime;
    }

    public void setPubTime(Date pubTime) {
        this.pubTime = pubTime;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

}
